﻿Imports Crystal.Common.Model
Imports System.Data.SqlClient
Imports Crystal.CLL


Public Class DeleteClient
#Region "Declare"
    Public Shared strConfiguration As String = CommonCLL.mstrConnectionstring
#End Region

#Region "Methods"
    Public Shared Function DeleteProjectClients(ByVal clientID As Integer, ByVal status As String) As Boolean
        Dim eReturnVal As ExecutionResult = Nothing
        Dim param(1) As SqlParameter
        param(0) = New SqlParameter("@clientID", clientID)
        param(1) = New SqlParameter("@Status", status)
        eReturnVal = CoreFunctions.Execute(strConfiguration, "CR_sp_CLT_DeleteClient", CommandType.StoredProcedure, ReturnTypes.Scalar, param)
        Return CType(eReturnVal.ResultObject, Boolean)
    End Function
    Public Shared Function IsClientDeleted(ByVal clientID As Integer) As Boolean
        Dim eReturnVal As ExecutionResult = Nothing
        Dim param(0) As SqlParameter
        param(0) = New SqlParameter("@ClientID", clientID)
        eReturnVal = CoreFunctions.Execute(strConfiguration, "CR_sp_CLT_IsClientDeleted", CommandType.StoredProcedure, ReturnTypes.Scalar, param)
        Return CType(eReturnVal.ResultObject, Boolean)
    End Function
    Public Shared Function CheckClientDeleted(ByVal clientID As Integer) As Boolean
        Dim eReturnVal As ExecutionResult = Nothing
        Dim param(0) As SqlParameter
        param(0) = New SqlParameter("@ClientID", clientID)
        eReturnVal = CoreFunctions.Execute(strConfiguration, "CR_sp_CLT_CheckClientDelete", CommandType.StoredProcedure, ReturnTypes.Scalar, param)
        Return CType(eReturnVal.ResultObject, Boolean)
    End Function
    Public Shared Function GetDeleteStatus(ByVal clientID As Integer) As DataSet
        Dim eReturnVal As ExecutionResult = Nothing
        Dim param(0) As SqlParameter
        param(0) = New SqlParameter("@ClientID", clientID)
        eReturnVal = CoreFunctions.Execute(strConfiguration, "CR_sp_CLT_GetProjectStatus", CommandType.StoredProcedure, ReturnTypes.DataSet, param)
        Return CType(eReturnVal.ResultObject, DataSet)
    End Function
#End Region

End Class
